<ul class="pagination">
	

	
		{%if $page.firstPage%}
			<li class="disabled">
		      	<a>首页</a>
		    </li>
		    <li class="disabled">
		      	<a>上一页</a>
		    </li>
		{%else%}
			<li>
		      <a href="javascript:pagego('1');">首页</a>
		    </li>
		    <li>
		      	<a href="javascript:pagego({%$page.page_code - 1%});">上一页</a>
		    </li>
		{%/if%}	
		{%foreach $page.page_code_list as $item%}
			{%if $page.page_code == $item%}
				<li class="active">
			      	<a>{%$item%}</a>
			    </li>
			{%else%}
				<li>
			      <a href="javascript:pagego({%$item%});">{%$item%}</a>
			    </li>
			{%/if%}	

		{%/foreach%}

		{%if $page.lastPage%}
			<li class="disabled">
		      	<a>下一页</a>
		    </li>
			<li class="disabled">
		      	<a>末页</a>
		    </li>

		{%else%}
			<li>
		      	<a href="javascript:pagego({%$page.page_code + 1%});">下一页</a>
		    </li>
			<li>
		      <a href="javascript:pagego({%$page.page_count%});">末页</a>
		    </li>
		{%/if%}	

	
	<li class="disabled"><a>共{%$page.data_count%}条 {%$page.page_count%}页</a></li>
</ul>
<script type="text/javascript">
	function pagego(num){
		var locSearch = window.location.search;
		if(locSearch != "" || locSearch != null && locSearch > 0){
			if(locSearch.indexOf("page_code") > 0){
				location.href = replaceParamVal(window.location.href, "page_code", num)
			}else{
				location.href = window.location.port+locSearch+"&page_code="+num;
			}
			// location.href = window.location.port+locSearch+"&page_code="+num;
		}else{
			location.href = window.location.port+"?page_code="+num;
		}	
	}
	function replaceParamVal(oldUrl, paramName, replaceWith) { //修改URL参数
	    var re = eval('/(' + paramName + '=)([^&]*)/gi');
	    var nUrl = oldUrl.replace(re, paramName + '=' + replaceWith);
	    return nUrl;
	}
</script>